<?php
	session_start(); 
	require_once("banco.php");
	$resposta = "";
	if(isset($_POST["nome"]) && isset($_POST["email"]) && isset($_POST["senha"])){
		$email = $_POST["email"];
		$result = mysql_query("select * from usuario where email='" . addslashes($email) . "'");
		if(mysql_num_rows($result)==0){
			//cadastrar
			mysql_query("insert into usuario (nome,email,senha) values ('" . addslashes($_POST["nome"]) . "','" . addslashes($email) . "','" . addslashes($_POST["senha"]) . "')");
			$resposta = "Cadastrado";
		}else{
			$resposta = "e-mail j&aacute; cadastrado.";
		}
	}
	echo $resposta;
?><?/*
<form action="?" method="post">
	<fieldset>
		<legend>Cadastro de Usu&aacute;rio</legend>
		<div>
			<label for="nome">Nome</label>
			<input type="text" id="nome" name="nome" />
		</div>
		<div>
			<label for="email">E-mail</label>
			<input type="text" id="email" name="email" />
		</div>
		<div>
			<label for="senha">Senha</label>
			<input type="password" id="senha" name="senha" />
		</div>
		<div>
			<label for="confSenha">Confirme a senha</label>
			<input type="password" id="confSenha" name="confSenha" />
		</div>
		<input type="submit" value="Ok">
	</fieldset>
</form>
*/
?>